import util.file as RF
import util.IO as RI
class Factory:
    def __init__(self,path):
        self.baseData=RF.read(path,gap='\\')
        self.caseData=[]
    def readme(self):
        for i in range(1,self.baseData.__len__()):
            with open(RF.getRootPath()+'data\dataBase\storageCases\\'+self.baseData[i][0]+'.md','r',encoding='utf-8') as f:
                fileData=f.read()
                fileDataList=fileData.split('\n')
                fileString=''.join(fileDataList)
                self.caseData.append([self.baseData[i][0],fileString])
            RI.progressBar(i,self.baseData.__len__())
        RF.write(RF.getRootPath()+'data\dataBase\case.csv',self.caseData,gap='\t')


if __name__ == '__main__':
    factory=Factory(RF.getRootPath()+'data\dataBase\storageWrq.csv')
    factory.readme()
